package thread.lock;

import thread.ThreadUtils;

public class InterruptTest {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            System.out.println("begin");
            synchronized (InterruptTest.class){
                try {
                    InterruptTest.class.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
//            try {
//                Thread.sleep(9999999);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
            System.out.println("end");
        });
        t1.start();
        ThreadUtils.sleep(2000);
        t1.interrupt();
    }
}
